package com.njym.java.security.app.biz;

import com.github.pagehelper.PageHelper;
import com.njym.java.security.app.entity.GroupsMsgContent;
import com.njym.java.security.app.entity.UserMessage;
import com.njym.java.security.app.mapper.GroupsMsgContentMapper;
import com.njym.java.security.common.biz.BaseBiz;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 
 *
 * @author lijie
 * @email 717057076@qq.com
 * @date 2019-11-22 16:44:11
 */
@Service
public class GroupsMsgContentBiz extends BaseBiz<GroupsMsgContentMapper,GroupsMsgContent> {
    @Resource
    private GroupsMsgContentMapper groupsMsgContentMapper;

    public List<GroupsMsgContent> queryGroupHistory(Integer groupId, Integer page, Integer limit){
        PageHelper.startPage(page, limit);
        return groupsMsgContentMapper.queryGroupHistory(groupId);
    }

    public int countGroupHistory(Integer groupId){
        return groupsMsgContentMapper.countGroupHistory(groupId);
    }

    public int deleteByGroupId(Integer groupId){
        return groupsMsgContentMapper.deleteByGroupId(groupId);
    }

    public int deleteByFromId(Integer groupId, Integer fromId){
        return groupsMsgContentMapper.deleteByFromId(groupId, fromId);
    }
}